package com.hakim.wfb.common.util;

/**
 * Created by Administrator on 2017/7/5.
 */
public class StringUtils {

    /**
     * 将source根据split来分割，并组合成前count数的字符串
     *
     * @param source
     * @param split
     * @param count
     * @return
     */
    public static String cutShort(String source, String split, int count) {

        String[] arr = source.split(split);

        if (arr.length <= 1)
            return "";

        if (count == 0)
            return "";

        if (count >= arr.length)
            return "";


        String result = "";
        for (int i = 0; i < count; i++) {
            result += arr[i] + split;
        }

        result = result.substring(0, result.length() - 1);

        return result;
    }




}
